part of '../repository.dart';

const _kGooglePlayPurchasedSubscriptionPauseAutoResumeTimeKey = 'auto_resume_time';

class _GooglePlayPurchasedSubscriptionPauseInfoDto extends Equatable {
  const _GooglePlayPurchasedSubscriptionPauseInfoDto._internal({
    required this.autoResumeTimeDto,
  });

  final ApiTimeDto autoResumeTimeDto;

  @override
  List<Object?> get props {
    return [
      autoResumeTimeDto,
    ];
  }

  factory _GooglePlayPurchasedSubscriptionPauseInfoDto.fromJson(Map<String, dynamic> json) {
    final autoResumeTimeString =
        json[_kGooglePlayPurchasedSubscriptionPauseAutoResumeTimeKey] as String;
    final autoResumeTimeDto = ApiTimeDto.fromString(autoResumeTimeString);

    return _GooglePlayPurchasedSubscriptionPauseInfoDto._internal(
      autoResumeTimeDto: autoResumeTimeDto,
    );
  }

  GooglePlayPurchasedSubscriptionPauseInfo toEntity() {
    return GooglePlayPurchasedSubscriptionPauseInfo(
      autoResumeTime: autoResumeTimeDto.toEntity(),
    );
  }
}
